﻿namespace Stickam_Client
{
    [DesignerGenerated]
    public __gc class Form_JoinRoom : public Form
    {
        // Methods
        [DebuggerNonUserCode]
        public: Form_JoinRoom()
        {
            this->InitializeComponent();
        }

        [DebuggerNonUserCode]
        protected: override void __gc* Dispose(Boolean __gc* disposing)
        {
            try
            {
                if (disposing && (this->components != 0))
                {
                    this->components->Dispose();
                }
            }
            finally
            {
                base->Dispose(disposing);
            }
        }

        private: void __gc* FormParent_RoomlistRetrieved(Boolean __gc* IsSuccess)
        {
            Int32 __gc* total = this->FormParent->Roomlist->total;
            if (IsSuccess & (total > 0))
            {
                Int32 __gc* num4 = (total - 1);
                for (Int32 __gc* i = 0; (i <= num4); i++)
                {
                    String __gc* str = S"[O]";
                    if ((this->FormParent->Roomlist->ArrayRoomPrivate[i] == S"true") | (this->FormParent->Roomlist->ArrayRoomProtected[i] == S"true"))
                    {
                        str = S"[X]";
                    }
                    this->Roomlist->Items->Add(String::Concat(__gc new String __gc*[5] {
                        str, S"(", this->FormParent->Roomlist->ArrayRoomPopulation[i], S") ", this->FormParent->Roomlist->ArrayRoomName[i]}));
                }
                Int32 __gc* selectedIndex = this->FormParent->Roomlist->selectedIndex;
                if ((selectedIndex != -1) & (selectedIndex < this->Roomlist->Items->Count))
                {
                    this->Roomlist->SelectedIndex = selectedIndex;
                }
            }
            this->RefreshList->Enabled = true;
        }

        [DebuggerStepThrough]
        private: void __gc* InitializeComponent()
        {
            ComponentResourceManager __gc* manager = __gc new ComponentResourceManager(__typeof(Form_JoinRoom));
            this->Roomlist = __gc new ListBox();
            this->JoinRoom = __gc new Button();
            this->RefreshList = __gc new Button();
            this->Label1 = __gc new Label();
            this->RoomName = __gc new TextBox();
            this->Label2 = __gc new Label();
            this->RoomID = __gc new TextBox();
            this->Label3 = __gc new Label();
            this->RoomPass = __gc new TextBox();
            this->SuspendLayout();
            this->Roomlist->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            this->Roomlist->FormattingEnabled = true;
            this->Roomlist->ItemHeight = 12;
            Point __gc* point = (1, 1);
            this->Roomlist->Location = point;
            this->Roomlist->Name = S"Roomlist";
            Size __gc* size = (140, 0x94);
            this->Roomlist->Size = size;
            this->Roomlist->TabIndex = 0;
            this->JoinRoom->Enabled = false;
            this->JoinRoom->FlatStyle = FlatStyle::Popup;
            this->JoinRoom->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (0x47, 150);
            this->JoinRoom->Location = point;
            this->JoinRoom->Name = S"JoinRoom";
            size = (70, 0x12);
            this->JoinRoom->Size = size;
            this->JoinRoom->TabIndex = 1;
            this->JoinRoom->Text = S"JOIN ROOM";
            this->JoinRoom->UseCompatibleTextRendering = true;
            this->JoinRoom->UseVisualStyleBackColor = true;
            this->RefreshList->FlatStyle = FlatStyle::Popup;
            this->RefreshList->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (1, 150);
            this->RefreshList->Location = point;
            this->RefreshList->Name = S"RefreshList";
            size = (0x45, 0x12);
            this->RefreshList->Size = size;
            this->RefreshList->TabIndex = 2;
            this->RefreshList->Text = S"REFRESH";
            this->RefreshList->UseCompatibleTextRendering = true;
            this->RefreshList->UseVisualStyleBackColor = true;
            this->Label1->AutoSize = true;
            this->Label1->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (-1, 0xac);
            this->Label1->Location = point;
            this->Label1->Name = S"Label1";
            size = (0x21, 12);
            this->Label1->Size = size;
            this->Label1->TabIndex = 3;
            this->Label1->Text = S"Name:";
            this->RoomName->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (0x1d, 0xa9);
            this->RoomName->Location = point;
            this->RoomName->Name = S"RoomName";
            size = (0x70, 0x12);
            this->RoomName->Size = size;
            this->RoomName->TabIndex = 4;
            this->Label2->AutoSize = true;
            this->Label2->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (-1, 0xbf);
            this->Label2->Location = point;
            this->Label2->Name = S"Label2";
            size = (0x12, 12);
            this->Label2->Size = size;
            this->Label2->TabIndex = 5;
            this->Label2->Text = S"ID:";
            this->RoomID->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (14, 0xbc);
            this->RoomID->Location = point;
            this->RoomID->Name = S"RoomID";
            size = (0x26, 0x12);
            this->RoomID->Size = size;
            this->RoomID->TabIndex = 6;
            this->RoomID->Text = S"804110";
            this->Label3->AutoSize = true;
            this->Label3->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (0x34, 0xbf);
            this->Label3->Location = point;
            this->Label3->Name = S"Label3";
            size = (0x1d, 12);
            this->Label3->Size = size;
            this->Label3->TabIndex = 7;
            this->Label3->Text = S"Pass:";
            this->RoomPass->Font = __gc new Font(S"Microsoft Sans Serif", 6.75, FontStyle::Regular, GraphicsUnit::Point, 0);
            point = (0x4e, 0xbc);
            this->RoomPass->Location = point;
            this->RoomPass->Name = S"RoomPass";
            size = (0x3f, 0x12);
            this->RoomPass->Size = size;
            this->RoomPass->TabIndex = 8;
            SizeF __gc* ef = (6, 13);
            this->AutoScaleDimensions = ef;
            this->AutoScaleMode = AutoScaleMode::Font;
            size = (0x8e, 0xcf);
            this->ClientSize = size;
            this->Controls->Add(this->RoomPass);
            this->Controls->Add(this->Label3);
            this->Controls->Add(this->RoomID);
            this->Controls->Add(this->Label2);
            this->Controls->Add(this->RoomName);
            this->Controls->Add(this->Label1);
            this->Controls->Add(this->RefreshList);
            this->Controls->Add(this->JoinRoom);
            this->Controls->Add(this->Roomlist);
            this->FormBorderStyle = FormBorderStyle::FixedToolWindow;
            this->Icon = *static_cast<__box Icon*>(manager->GetObject(S"$this.Icon"));
            this->MaximizeBox = false;
            this->Name = S"Form_JoinRoom";
            this->StartPosition = FormStartPosition::Manual;
            this->Text = S"Join A Room";
            this->ResumeLayout(false);
            this->PerformLayout();
        }

        private: void __gc* JoinRoom_Click(Object __gc* sender, EventArgs __gc* e)
        {
            this->FormParent->doJoin(this->RoomID->Text, this->RoomName->Text, this->RoomPass->Text);
            this->Close();
        }

        private: void __gc* RefreshList_Click(Object __gc* sender, EventArgs __gc* e)
        {
            this->RefreshList->Enabled = false;
            this->Roomlist->Items->Clear();
            this->FormParent->getRoomlist();
        }

        private: void __gc* Roomlist_SelectedIndexChanged(Object __gc* sender, EventArgs __gc* e)
        {
            Int32 __gc* selectedIndex = this->Roomlist->SelectedIndex;
            if (selectedIndex != -1)
            {
                this->JoinRoom->Enabled = true;
                this->FormParent->Roomlist->selectedIndex = selectedIndex;
                this->RoomID->Text = this->FormParent->Roomlist->ArrayRoomID[selectedIndex];
                this->RoomName->Text = this->FormParent->Roomlist->ArrayRoomName[selectedIndex];
            }
            else
            {
                this->JoinRoom->Enabled = false;
            }
        }


        // Properties
        [DebuggerNonUserCode]
        public: __property virtual Form1 __gc* get_FormParent()
        {
            return this->_FormParent;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public: __property virtual void __gc* set_FormParent(Form1 __gc* WithEventsValue)
        {
            RoomlistRetrievedEventHandler __gc* handler = new RoomlistRetrievedEventHandler __gc*(this.FormParent_RoomlistRetrieved);
            if (this->_FormParent != 0)
            {
                this->_FormParent->RoomlistRetrieved -= handler;
            }
            this->_FormParent = WithEventsValue;
            if (this->_FormParent != 0)
            {
                this->_FormParent->RoomlistRetrieved += handler;
            }
        }

        [DebuggerNonUserCode]
        public private: __property virtual Button __gc* get_JoinRoom()
        {
            return this->_JoinRoom;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_JoinRoom(Button __gc* WithEventsValue)
        {
            EventHandler __gc* handler = new EventHandler __gc*(this.JoinRoom_Click);
            if (this->_JoinRoom != 0)
            {
                this->_JoinRoom->Click -= handler;
            }
            this->_JoinRoom = WithEventsValue;
            if (this->_JoinRoom != 0)
            {
                this->_JoinRoom->Click += handler;
            }
        }

        [DebuggerNonUserCode]
        public private: __property virtual Label __gc* get_Label1()
        {
            return this->_Label1;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_Label1(Label __gc* WithEventsValue)
        {
            this->_Label1 = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual Label __gc* get_Label2()
        {
            return this->_Label2;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_Label2(Label __gc* WithEventsValue)
        {
            this->_Label2 = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual Label __gc* get_Label3()
        {
            return this->_Label3;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_Label3(Label __gc* WithEventsValue)
        {
            this->_Label3 = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual Button __gc* get_RefreshList()
        {
            return this->_RefreshList;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_RefreshList(Button __gc* WithEventsValue)
        {
            EventHandler __gc* handler = new EventHandler __gc*(this.RefreshList_Click);
            if (this->_RefreshList != 0)
            {
                this->_RefreshList->Click -= handler;
            }
            this->_RefreshList = WithEventsValue;
            if (this->_RefreshList != 0)
            {
                this->_RefreshList->Click += handler;
            }
        }

        [DebuggerNonUserCode]
        public private: __property virtual TextBox __gc* get_RoomID()
        {
            return this->_RoomID;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_RoomID(TextBox __gc* WithEventsValue)
        {
            this->_RoomID = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual ListBox __gc* get_Roomlist()
        {
            return this->_Roomlist;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_Roomlist(ListBox __gc* WithEventsValue)
        {
            EventHandler __gc* handler = new EventHandler __gc*(this.Roomlist_SelectedIndexChanged);
            if (this->_Roomlist != 0)
            {
                this->_Roomlist->SelectedIndexChanged -= handler;
            }
            this->_Roomlist = WithEventsValue;
            if (this->_Roomlist != 0)
            {
                this->_Roomlist->SelectedIndexChanged += handler;
            }
        }

        [DebuggerNonUserCode]
        public private: __property virtual TextBox __gc* get_RoomName()
        {
            return this->_RoomName;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_RoomName(TextBox __gc* WithEventsValue)
        {
            this->_RoomName = WithEventsValue;
        }

        [DebuggerNonUserCode]
        public private: __property virtual TextBox __gc* get_RoomPass()
        {
            return this->_RoomPass;
        }
        [MethodImpl(MethodImplOptions::Synchronized), DebuggerNonUserCode]
        public private: __property virtual void __gc* set_RoomPass(TextBox __gc* WithEventsValue)
        {
            this->_RoomPass = WithEventsValue;
        }


        // Fields
        [AccessedThroughProperty(S"FormParent")]
        private: Form1 __gc* _FormParent;
        [AccessedThroughProperty(S"JoinRoom")]
        private: Button __gc* _JoinRoom;
        [AccessedThroughProperty(S"Label1")]
        private: Label __gc* _Label1;
        [AccessedThroughProperty(S"Label2")]
        private: Label __gc* _Label2;
        [AccessedThroughProperty(S"Label3")]
        private: Label __gc* _Label3;
        [AccessedThroughProperty(S"RefreshList")]
        private: Button __gc* _RefreshList;
        [AccessedThroughProperty(S"RoomID")]
        private: TextBox __gc* _RoomID;
        [AccessedThroughProperty(S"Roomlist")]
        private: ListBox __gc* _Roomlist;
        [AccessedThroughProperty(S"RoomName")]
        private: TextBox __gc* _RoomName;
        [AccessedThroughProperty(S"RoomPass")]
        private: TextBox __gc* _RoomPass;
        private: IContainer __gc* components;
    };
}

